package com.sgcc.sguap.bluefw.jit.repository;

import java.util.List;

import org.hibernate.SessionFactory;

import com.sgcc.sguap.bluefw.jit.domain.ProductLine;

import io.dropwizard.hibernate.AbstractDAO;

public class ProductLineDAO extends AbstractDAO<ProductLine>{

	public ProductLineDAO(SessionFactory factory) {
		super(factory);
	}

    public ProductLine findById(Long id) {
        return get(id);
    }

    public ProductLine persist(ProductLine pl) {
        return super.persist(pl);
    }
    
    public List<ProductLine> findAll() {
    	return list(currentSession().createQuery("SELECT p FROM ProductLine p"));
    }
    
    public void delete(Long id) {
    	this.currentSession().delete(get(id));
    }
}
